///////////////////////////////////////////////////////////
//  BaseGameStream.as
//  Actionscript 3.0 implementation of Interface IGOStatePosition
//  owner: http://www.imanit.com/
//  resource page: http://www.scuge.com/ 
//  For Game Architecture or Flash Team Management Consulting contact iman@imanit.com
//  This code is without warranty and is to be used at your own risk.
//  Created on:      06-Dec-2009 5:02:45 PM
//  Original author: iMAN
///////////////////////////////////////////////////////////

package org.gof.stream
{
	import com.iMANIT.OO.ThisIs;
	
	import flash.display.DisplayObjectContainer;
	import org.gof.state.BaseGameState;
	/**
	 * The game stream is a facade that abstracts all logic for the entities in the game that interact with eachother.
	 * This 
	 * @author iMAN
	 * @version 1.0
	 * @created 06-Dec-2009 5:02:45 PM
	 */
	public class BaseGameStream
	{
		 /**
	     * need to use class variable to keep reference of GameStream.
	     */
	    protected var gameLoop: BaseGameLoop;
	    private var _settings: ISettings;
	    /**
	     * Game is rendered onto this container.
	     */
	    protected var viewPort:DisplayObjectContainer;
	    
	    protected var gameState: BaseGameState;
	    
		public function BaseGameStream(viewPort:DisplayObjectContainer)
		{
			this.viewPort = viewPort;
		}
		
		public function set settings(s:ISettings): void
		{
			gameState.settings = s;
		}
		public function get settings(): ISettings
		{
			return (gameState.settings);
		}
		
		/**
	     * adds a game object to the game
	     * 
	     * @param myGO    myGO
	     */
	    
		protected function addGameObject(myGO:BaseGameObject, gameObjectMeta:IGOInputMeta = null): void
		{
			gameLoop.addGameObject(myGO);
		}
		
		public function start(initialSettings:ISettings = null):void
		{
			gameLoop.start();
		}
		
		public function stop():void
		{
			gameLoop.stop();
		}
		
		
	}
}